1. Technical Field
The present invention is generally directed to an improved computing system. More specifically, the present invention is directed to an apparatus and method for obtaining string representations of nodes in displayed hierarchical structures.
2. Description of Related Art
To ensure that applications perform and operate as expected, they need to be tested prior to release. Such testing involves the adoption of a test management strategy followed by the performance of load testing and functional testing on the applications. Load testing involves the emulation of multiple users interacting with an application infrastructure to ascertain where any bottlenecks may exist. Functional testing involves automatically capturing, verifying and replaying user interactions to determine if the applications function as expected.
A known mechanism for performing functional tests on applications is the WinRunner program available from Mercury Interactive. With the WinRunner program, test scripts are generated by recording a user's interaction with a particular version of an application's graphical user interface (GUI). The recording is then later replayed to test the application, or other versions of the application, with different data sets. Reports are generated indicating the events occurring during the test and any errors that may occur.
A problem with GUI test harnesses, such as WinRunner, is the representation of nodes of hierarchical structures, such as tree and list structures, in such a way that a user may specify an appropriate string in a test script for selecting the node that they see on the screen. This is a significant problem because the tree nodes and list items may be arbitrary objects, making it extremely difficult to convert what the user sees on the screen to a string representation that they can use to specify which tree node or list item they wish to select.
Typically, in order to obtain a string representation of the node in a tree or list structure in an object oriented environment, such as a Java JTree or JList a call to the method toString( ) on the node itself is used. However, with complex objects, i.e. objects whose toString( ) does not return what is seen on the screen such as a container object which contains an image object and a text label object, the string returned by this method does not bear any resemblance to the object depicted in the tree or list structure. As a result, if the user were to try and correlate the string returned by toString( ) with the tree or list at a later time, it would be very difficult to identify which node in the tree or list corresponds to this string.
For example, assume that there is a tree structure having the following organization:
HostnameDirectory 1Directory 2SubDirectory 1
When generating a test script for a testing harness by recording the user's interaction with the GUI, when the user selects the SubDirectory 1 from the tree structure, it is necessary to convert the displayed object, i.e. node, into a string representation of the object. Using known mechanisms to obtain this string representation, e.g., using the toString( ) method call on the SubDirectory 1 node, a string representation is returned that bears no likeness to the tree structure shown above. For example, a string such as the following may be returned:Hostname: implicit method call getHost|_Directory: level 2 implicit Call 5|_Directory:Level 2 implicit Call 5
where the symbol “|_” is a separator that indicates traversing down into the tree structure. It is clear from the above, that if a user, at a later time, attempts to resolve this string to a displayed node in the tree structure, it would be very difficult for that user to identify which node in the tree structure corresponds to the string.
Thus, it would be beneficial to have an apparatus and method that is capable of automatically identifying a selected tree or list object with a string representation that resembles the displayed node in its tree or list structure.